Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-header

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-header

Gulp extension to add header to file(s) in the pipeline.

  • 1.8.12
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
144K
decreased by-61.25%
Maintainers
1
Weekly downloads
 
Created

What is gulp-header?

The gulp-header npm package is a Gulp plugin that allows you to add headers to your files. This can be useful for adding comments, metadata, or any other text at the beginning of your files during the build process.

What are gulp-header's main functionalities?

Add a simple header

This feature allows you to add a simple header to your files. The example code adds a comment with the project name, version, and current date to the top of all JavaScript files in the 'src' directory and outputs them to the 'dist' directory.

const gulp = require('gulp');
const header = require('gulp-header');

const banner = '/* My Project - v1.0.0 - ' + new Date().toISOString() + ' */\n';

gulp.task('add-header', function() {
  return gulp.src('src/*.js')
    .pipe(header(banner))
    .pipe(gulp.dest('dist'));
});

Add a header with dynamic content

This feature allows you to add a header with dynamic content using template strings. The example code uses data from the package.json file to create a header with the project name, version, description, and author.

const gulp = require('gulp');
const header = require('gulp-header');

const pkg = require('./package.json');
const banner = ['/**',
  ' * <%= pkg.name %> - <%= pkg.version %>',
  ' * <%= pkg.description %>',
  ' * (c) ' + new Date().getFullYear() + ' <%= pkg.author %>',
  ' */',
  ''].join('\n');

gulp.task('add-header', function() {
  return gulp.src('src/*.js')
    .pipe(header(banner, { pkg: pkg }))
    .pipe(gulp.dest('dist'));
});

Other packages similar to gulp-header

Keywords

FAQs

Package last updated on 08 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc